﻿$(document).ready(function () {
    $('#fileManageModal').on('shown.bs.modal', function () {
        $.ajax({
            url: "~/../../Report/FileManagePartial",
            type: "GET",
            cache: false,
            success: function (data) {
                $('#bodyContent').html(data);
            }
        });  
    });
});
function ReportDesignerStaticClass() {
}

ReportDesignerStaticClass.Command = null;
ReportDesignerStaticClass.Param = null;

//打开文件事件
ReportDesignerStaticClass.OpenFile = function(path) {
    if (path) {
        ReportDesignerStaticClass.Param = path;
        ReportDesignerStaticClass.Command = "open";
        if (!spreadsheet.InCallback())
            spreadsheet.PerformCallback({ "command": ReportDesignerStaticClass.Command, "param": path });
    }
};
//新建文件事件
ReportDesignerStaticClass.CreateNew = function () {
    ReportDesignerStaticClass.Command = "create";
    if (!spreadsheet.InCallback())
        spreadsheet.PerformCallback({ "command": ReportDesignerStaticClass.Command, "param": "" });
};
ReportDesignerStaticClass.OnSpreadsheetBeginCallback = function (s, e) {
    e.customArgs["param"] = ReportDesignerStaticClass.Command;
    e.customArgs["param"] = ReportDesignerStaticClass.Param;
    ReportDesignerStaticClass.Param = null;
    ReportDesignerStaticClass.Command = null;
};
ReportDesignerStaticClass.OnSpreadsheetEndCallback = function (s, e) {
    if (ReportDesignerStaticClass.Command != null)
        spreadsheet.PerformCallback();
};
var tempFlag = false;
//Menu事件
ReportDesignerStaticClass.SpreadSheet_CuntomCommand = function (s, e) {
    switch (e.commandName) {
        case "FileManageLink":
            $('#fileManageModal').modal('show');
            break;
        case "HourDataLink":
            $('#hourModal').modal('show');
            break;
        case "DayDataLink":
            $('#dayModal').modal('show');
            break;
        case "MonthDataLink":
            $('#monthModal').modal('show');
            break;
    }
};
ReportDesignerStaticClass.SetActiveCellValue = function (spreadsheet, cellValue) {
    var stateController = spreadsheet.getStateController();
    stateController.setEditMode(ASPxClientSpreadsheet.StateController.Modes.Edit);
    spreadsheet.setElementsValue(cellValue);
};